package com.tianxia120.website.data.handler;

import com.jfinal.handler.Handler;
import com.tianxia120.website.data.utils.FieldUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @createTime: 2018/7/24
 * @author: HingLo
 * @description: 指定环境能够允许读取的请求头
 */
public class AllowHeaderHandler extends Handler {

    @Override
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
        response.setHeader("Access-Control-Expose-Headers", FieldUtils.AUTHORIZATION);
        next.handle(target, request, response, isHandled);
    }
}
